package com.example.demo;

import com.netflix.hystrix.HystrixCommand;
import com.netflix.hystrix.HystrixCommandGroupKey;

/**
 * @author wangl
 * @desc
 * @date:2017/11/1410:08
 * @Copyright (c) 2017, DaChen All Rights Reserved.
 */
public class CommandHelloWrold extends HystrixCommand<String> {

    private final String name;

    public CommandHelloWrold(String name) {
        super(HystrixCommandGroupKey.Factory.asKey("ExampleGroup"));
        this.name = name;
    }

    @Override
    protected String run() throws Exception {
        return "hello "+name+" !";
    }

    public static void main(String[] args) {
        String s = new CommandHelloWrold("bob").execute();
    }
}
